package com.neusoft.demo.controller;


import com.neusoft.demo.pojo.Yuangong;
import com.neusoft.demo.server.YuangongServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@Controller
@RequestMapping("/yuangong")
public class YuangongController {
    @Autowired
    YuangongServer yuangongServer;

    @ResponseBody
    @RequestMapping("/findYuangong")
    public java.util.List<Yuangong> yuangongList(){
        return  yuangongServer.yuangongList();
    }

    @ResponseBody
    @RequestMapping("/findYuangongById")
    public java.util.List<Yuangong> yuangongListById(Integer id){
        return yuangongServer.findYuangongById(id);
    }

    @ResponseBody
    @RequestMapping("/edit")
    public boolean editYuangong(Yuangong yuangong){

        return  yuangongServer.updateYuangong(yuangong);
    }

    @ResponseBody
    @RequestMapping("/del")
    public  boolean delYuangong(int yid){
        return yuangongServer.delYuangong(yid);
    }

    @ResponseBody
    @RequestMapping("/add")
    public boolean inYuangong(Yuangong yuangong){

        return  yuangongServer.inYuangong(yuangong);
    }

    @ResponseBody
    @RequestMapping("/search")
    public java.util.List<Yuangong> yuangongSearch(String yname,int beginSal,int endSal){
        return yuangongServer.yuangongSearch(yname, beginSal, endSal);
    }

}
